#define bot_controller
// set name of the bot
_sf = get_string("Set the name of the character..", "");
// if the name is empty..
if _sf = "" {
// again name of the bot
_sf = get_string("Set the name of the character..", "This time correctly..");
        }
// create the file + _w.c extention and others
file_text_close(file_text_open_write(_sf +'_w.c'));
file_text_close(file_text_open_write(_sf +'_t.c'));
file_text_close(file_text_open_write(_sf +'_i.c'));
file_text_close(file_text_open_write(_sf +'_c.c'));

switch (show_message_ext('Would you like to edit the bot yourself ?#Or do you want to randomize the bot..','Edit','Randomize','Quit'))
{
   case 0: {game_end() break}
   case 1: {
goom1=ceil(random(500));
goom2=ceil(random(500));
goom3=ceil(random(500));
goom4=ceil(random(500));
goom5=ceil(random(500));
goom6=ceil(random(500));
goom7=ceil(random(500));
goom8=ceil(random(500));
goom9=ceil(random(500));
goom10=ceil(random(500));
goom11=ceil(random(500));
goom12=ceil(random(500));   
// write some lines..
w=file_text_open_write(_sf +'_w.c');
file_text_write_string(w,"/*");
file_text_writeln(w);
file_text_write_string(w,"===========================================================================");
file_text_writeln(w);
file_text_write_string(w,"Copyright (C) 2011 Botgenerator v1.0 (made by: cooltech (mootrix@gmail.com))");
file_text_writeln(w);
file_text_write_string(w,"===========================================================================");
file_text_writeln(w);
file_text_write_string(w,"Copyright (C) 2006 Dmn_clown (aka: Bob Isaac (rjisaac@gmail.com))");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"This file is part of Open Arena and is based upon Mr. Elusive's fuzzy logic");
file_text_writeln(w);
file_text_write_string(w,"system found in Quake 3 Arena.");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"Open Arena is free software; you can redistribute it");
file_text_writeln(w);
file_text_write_string(w,"and/or modify it under the terms of the GNU General Public License as");
file_text_writeln(w);
file_text_write_string(w,"published by the Free Software Foundation; either version 2 of the License,");
file_text_writeln(w);
file_text_write_string(w,"or (at your option) any later version.");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"Open Arena is distributed in the hope that it will be");
file_text_writeln(w);
file_text_write_string(w,"useful, but WITHOUT ANY WARRANTY; without even the implied warranty of");
file_text_writeln(w);
file_text_write_string(w,"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the");
file_text_writeln(w);
file_text_write_string(w,"GNU General Public License for more details.");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"You should have received a copy of the GNU General Public License");
file_text_writeln(w);
file_text_write_string(w,"along with Foobar; if not, write to the Free Software");
file_text_writeln(w);
file_text_write_string(w,"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA");
file_text_writeln(w);
file_text_write_string(w,"===========================================================================");
file_text_writeln(w);
file_text_write_string(w,"*/");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,'#include "inv.h"');
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,'//gauntlet');
file_text_writeln(w);
_GTW = get_string("Set the gauntlet using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom1));
file_text_write_string(w,'#define GTW                   ');
file_text_write_string(w,_GTW);
file_text_writeln(w);
file_text_write_string(w,'//shotgun');
file_text_writeln(w);
_SGW = get_string("Set the shotgun using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom2));
file_text_write_string(w,'#define SGW                   ');
file_text_write_string(w,_SGW);
file_text_writeln(w);
file_text_write_string(w,'//machinegun');
file_text_writeln(w);
_MGW = get_string("Set the machinegun using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom3));
file_text_write_string(w,'#define MGW                   ');
file_text_write_string(w,_MGW);
file_text_writeln(w);
file_text_write_string(w,'//grenade launcher');
file_text_writeln(w);
_GLW = get_string("Set the grenadel auncher using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom4));
file_text_write_string(w,'#define GLW                   ');
file_text_write_string(w,_GLW);
file_text_writeln(w);
file_text_write_string(w,'//rocket launcher');
file_text_writeln(w);
_RLW = get_string("Set the rocket launcher using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom5));
file_text_write_string(w,'#define RLW                   ');
file_text_write_string(w,_RLW);
file_text_writeln(w);
file_text_write_string(w,'//bfg10k');
file_text_writeln(w);
_BFW = get_string("Set the BFG10K using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom6));
file_text_write_string(w,'#define BFW                   ');
file_text_write_string(w,_BFW);
file_text_writeln(w);
file_text_write_string(w,'//lightninggun');
file_text_writeln(w);
_LGW = get_string("Set the lightning gun using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom7));
file_text_write_string(w,'#define LGW                   ');
file_text_write_string(w,_LGW);
file_text_writeln(w);
file_text_write_string(w,'//plasmagun');
file_text_writeln(w);
_PGW = get_string("Set the plasma gun using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom8));
file_text_write_string(w,'#define PGW                   ');
file_text_write_string(w,_PGW);
file_text_writeln(w);
file_text_write_string(w,'//grapplinghook');
file_text_writeln(w);
_GRW = get_string("Set the grapplinghook using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom9));
file_text_write_string(w,'#define GRW                   ');
file_text_write_string(w,_GRW);
file_text_writeln(w);
file_text_write_string(w,'//prox-launcher');
file_text_writeln(w);
_PXW = get_string("Set the prox-launcher using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom10));
file_text_write_string(w,'#define PXW                   ');
file_text_write_string(w,_PXW);
file_text_writeln(w);
file_text_write_string(w,'//nailgun');
file_text_writeln(w);
_NGW = get_string("Set the nailgun using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom11));
file_text_write_string(w,'#define NGW                   ');
file_text_write_string(w,_NGW);
file_text_writeln(w);
file_text_write_string(w,'//chaingun');
file_text_writeln(w);
_CGW = get_string("Set the chaingun using for the bot..#(Numbers from 0 to 500 to keep it real!)##EX. 50 is not much use, 500 always use..",string(goom12));
file_text_write_string(w,'#define CGW                   ');
file_text_write_string(w,_CGW);
file_text_writeln(w);
file_text_write_string(w,'#include "fuzw.c"');
file_text_writeln(w);
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,'//thankyou for using botmaker! :)');
file_text_writeln(w);
file_text_write_string(w,'//Please check our code svn: http://code.google.com/p/botcreator/ for updates');
file_text_close(w); break}
   case 2: {
goomw1=ceil(random(500));
goomw2=ceil(random(500));
goomw3=ceil(random(500));
goomw4=ceil(random(500));
goomw5=ceil(random(500));
goomw6=ceil(random(500));
goomw7=ceil(random(500));
goomw8=ceil(random(500));
goomw9=ceil(random(500));
goomw10=ceil(random(500));
goomw11=ceil(random(500));
goomw12=ceil(random(500));
w=file_text_open_write(_sf +'_w.c');
file_text_write_string(w,"/*");
file_text_writeln(w);
file_text_write_string(w,"===========================================================================");
file_text_writeln(w);
file_text_write_string(w,"Copyright (C) 2011 Botgenerator v1.0 (made by: cooltech (mootrix@gmail.com))");
file_text_writeln(w);
file_text_write_string(w,"===========================================================================");
file_text_writeln(w);
file_text_write_string(w,"Copyright (C) 2006 Dmn_clown (aka: Bob Isaac (rjisaac@gmail.com))");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"This file is part of Open Arena and is based upon Mr. Elusive's fuzzy logic");
file_text_writeln(w);
file_text_write_string(w,"system found in Quake 3 Arena.");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"Open Arena is free software; you can redistribute it");
file_text_writeln(w);
file_text_write_string(w,"and/or modify it under the terms of the GNU General Public License as");
file_text_writeln(w);
file_text_write_string(w,"published by the Free Software Foundation; either version 2 of the License,");
file_text_writeln(w);
file_text_write_string(w,"or (at your option) any later version.");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"Open Arena is distributed in the hope that it will be");
file_text_writeln(w);
file_text_write_string(w,"useful, but WITHOUT ANY WARRANTY; without even the implied warranty of");
file_text_writeln(w);
file_text_write_string(w,"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the");
file_text_writeln(w);
file_text_write_string(w,"GNU General Public License for more details.");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,"You should have received a copy of the GNU General Public License");
file_text_writeln(w);
file_text_write_string(w,"along with Foobar; if not, write to the Free Software");
file_text_writeln(w);
file_text_write_string(w,"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA");
file_text_writeln(w);
file_text_write_string(w,"===========================================================================");
file_text_writeln(w);
file_text_write_string(w,"*/");
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,'#include "inv.h"');
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,'//gauntlet');
file_text_writeln(w);
file_text_write_string(w,'#define GTW                   ');
file_text_write_string(w,string(goomw1));
file_text_writeln(w);
file_text_write_string(w,'//shotgun');
file_text_writeln(w);
file_text_write_string(w,'#define SGW                   ');
file_text_write_string(w,string(goomw2));
file_text_writeln(w);
file_text_write_string(w,'//machinegun');
file_text_writeln(w);
file_text_write_string(w,'#define MGW                   ');
file_text_write_string(w,string(goomw3));
file_text_writeln(w);
file_text_write_string(w,'//grenade launcher');
file_text_writeln(w);
file_text_write_string(w,'#define GLW                   ');
file_text_write_string(w,string(goomw4));
file_text_writeln(w);
file_text_write_string(w,'//rocket launcher');
file_text_writeln(w);
file_text_write_string(w,'#define RLW                   ');
file_text_write_string(w,string(goomw5));
file_text_writeln(w);
file_text_write_string(w,'//bfg10k');
file_text_writeln(w);
file_text_write_string(w,'#define BFW                   ');
file_text_write_string(w,string(goomw6));
file_text_writeln(w);
file_text_write_string(w,'//lightninggun');
file_text_writeln(w);
file_text_write_string(w,'#define LGW                   ');
file_text_write_string(w,string(goomw7));
file_text_writeln(w);
file_text_write_string(w,'//plasmagun');
file_text_writeln(w);
file_text_write_string(w,'#define PGW                   ');
file_text_write_string(w,string(goomw8));
file_text_writeln(w);
file_text_write_string(w,'//grapplinghook');
file_text_writeln(w);
file_text_write_string(w,'#define GRW                   ');
file_text_write_string(w,string(goomw9));
file_text_writeln(w);
file_text_write_string(w,'//prox-launcher');
file_text_writeln(w);
file_text_write_string(w,'#define PXW                   ');
file_text_write_string(w,string(goomw10));
file_text_writeln(w);
file_text_write_string(w,'//nailgun');
file_text_writeln(w);
file_text_write_string(w,'#define NGW                   ');
file_text_write_string(w,string(goomw11));
file_text_writeln(w);
file_text_write_string(w,'//chaingun');
file_text_writeln(w);
file_text_write_string(w,'#define CGW                   ');
file_text_write_string(w,string(goomw12));
file_text_writeln(w);
file_text_write_string(w,'#include "fuzw.c"');
file_text_writeln(w);
file_text_writeln(w);
file_text_writeln(w);
file_text_write_string(w,'//thankyou for using botmaker! :)');
file_text_writeln(w);
file_text_write_string(w,'//Please check our code svn: http://code.google.com/p/botcreator/ for updates');
file_text_close(w); break}
   case 3: {game_end() break}
}

